<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/common.jsp"%>
<title>系统参数修改</title>
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form" action="" method="post">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单号长度：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.orderNoLength}" placeholder="" id="orderNoLength" name="orderNoLength" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">未支付订单过期时间（分钟）：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.orderOutTimes}" id="orderOutTimes" name="orderOutTimes">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>提现手续费扣费率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.cashFeeRate}" placeholder="" id="cashFeeRate" name="cashFeeRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>粉丝积分转贝币比率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.fansWeibiToJinbiRate}" placeholder="" id="fansWeibiToJinbiRate" name="fansWeibiToJinbiRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>会员积分转贝币比率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.vipWeibiToJinbiRate}" placeholder="" id="vipWeibiToJinbiRate" name="vipWeibiToJinbiRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>代理积分转贝币比率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.agenterWeibiToJinbiRate}" placeholder="" id="agenterWeibiToJinbiRate" name="agenterWeibiToJinbiRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>合伙人积分转贝币比率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.partnerWeibiToJinbiRate}" placeholder="" id="partnerWeibiToJinbiRate" name="partnerWeibiToJinbiRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>合伙人数量限制：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.partnerCountsLimit}" placeholder="" id="partnerCountsLimit" name="partnerCountsLimit" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>代理提现时，返给合伙人的贝币比率：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.partnerJinbiFromAgentCashRate}" placeholder="" id="partnerJinbiFromAgentCashRate" name="partnerJinbiFromAgentCashRate" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>推广赠送积分：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.spreadGiveWeiBi}" placeholder="" id="spreadGiveWeiBi" name="spreadGiveWeiBi" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>推广赠送贝币：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="${thisSystem.spreadGiveJinBi}" placeholder="" id="spreadGiveJinBi" name="spreadGiveJinBi" required="true">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-8 col-xs-offset-4 col-sm-offset-3">
                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
            </div>
        </div>
    </form>
</article>

<script type="text/javascript">
$(document).ready(function(){
	 var id = "${id}";
	 $('#form').bind('submit', function () {
		var orderNoLength = $("#orderNoLength").val();
		var orderOutTimes = $("#orderOutTimes").val();
		var cashFeeRate = $("#cashFeeRate").val();
		var fansWeibiToJinbiRate = $("#fansWeibiToJinbiRate").val();
		var vipWeibiToJinbiRate = $("#vipWeibiToJinbiRate").val();
		var agenterWeibiToJinbiRate = $("#agenterWeibiToJinbiRate").val();
		var partnerWeibiToJinbiRate = $("#partnerWeibiToJinbiRate").val();
		var partnerCountsLimit = $("#partnerCountsLimit").val();
		var partnerJinbiFromAgentCashRate = $("#partnerJinbiFromAgentCashRate").val();
		var spreadGiveWeiBi = $("#spreadGiveWeiBi").val();
		var spreadGiveJinBi = $("#spreadGiveJinBi").val();
		$.ajax({
			type : 'POST',
			url : ctx + '/systemManage/updateSystemParam.do',
			data : {
				id : id,
				orderNoLength : orderNoLength,
				orderOutTimes : orderOutTimes,
				cashFeeRate : cashFeeRate,
				fansWeibiToJinbiRate : fansWeibiToJinbiRate,
				vipWeibiToJinbiRate : vipWeibiToJinbiRate,
				agenterWeibiToJinbiRate : agenterWeibiToJinbiRate,
				partnerWeibiToJinbiRate : partnerWeibiToJinbiRate,
				partnerCountsLimit : partnerCountsLimit,
				spreadGiveWeiBi : spreadGiveWeiBi,
				spreadGiveJinBi : spreadGiveJinBi,
				partnerJinbiFromAgentCashRate : partnerJinbiFromAgentCashRate
			},
			dataType : 'json',
			timeout : 30000,
			context : $('body'),
			success : function(data) {
				if (data.code == "ok") {
					 layer.msg("保存成功!", {icon: 6, time: 1000}, function () {
						 layer_close();
	                    });
				} else {
					 layer.msg(data.msg, {icon: 5, time: 2000});
				}
			},
			error : function(xhr, type) {
				layer.msg('保存失败!', {icon: 5, time: 2000});
			}
		});
		return false;
	 });
});
</script>
</body>
</html>